//1.导入核心包vue
import Vue from 'vue';

//2.导入App.vue的vue对象
import App from './App.vue';

import vueRouter from 'vue-router';

Vue.use(vueRouter);

import login from './components/account/login.vue';
import register from './components/account/register.vue';

import home from './components/Home.vue';
import shopcar from './components/shopcar/car.vue';

import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';

import photolist from './components/photo/phptolist.vue';
import photoinfo from './components/photo/photoinfo.vue';

var router1 = new vueRouter({
    routes: [
        { path: '/', redirect: '/home' },
        { path: '*', redirect: '/home' },
        { path: '/home', component: home },
        { path: '/shopcar', component: shopcar },
        { path: '/news/newslist', component: newslist },
        { path: '/news/newsinfo/:id', component: newsinfo },
        { path: '/photo/photolist', component: photolist },
        { path: '/photo/photoinfo/:id', component: photoinfo }
    ]
})

import 'mint-ui/lib/style.css';

import mintui from 'mint-ui';

Vue.use(mintui);

import '../statics/mui/css/mui.css';

import '../statics/css/site.css';

//导入 vue-resource
import VueResource from 'vue-resource';
Vue.use(VueResource);

import moment from 'moment';

Vue.filter('datefmt', function(input, formatString) {
    return moment(input).format(formatString);
})

import VuePreview from 'vue-preview';
Vue.use(VuePreview);


//3.利用Vue对象进行解析渲染
new Vue({
    el: '#app',
    router: router1,
    render: c => c(App)
})